package com.digitalgeko.hourreporter.complements;

import com.digitalgeko.hourreporter.R;
import com.digitalgeko.hourreporter.fragments.MenuFragment;
import com.korovyansk.android.slideout.SlideoutActivity;
import com.korovyansk.android.slideout.SlideoutHelper;

import android.annotation.TargetApi;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.support.v4.app.*;
import android.util.Log;
import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.View;

public class ProyectActivity extends FragmentActivity {
	
	protected SlideoutHelper mSlideoutHelper;
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		MenuFragment.actividadesLevantadas.add(this);
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
	}
	
	
	public void sampleButtonClick(View v){
		MenuFragment.actual = this;
		
		int width = (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 40, getResources().getDisplayMetrics());
		SlideoutActivity.prepare(this, R.id.inner_content, width);
		
		mSlideoutHelper = new SlideoutHelper(this);
	    mSlideoutHelper.activate();
	    getSupportFragmentManager().beginTransaction().add(com.korovyansk.android.slideout.R.id.slideout_placeholder, new MenuFragment(), "menu").commit();
	    mSlideoutHelper.open();
		
		overridePendingTransition(0, 0);
	}

	public void closeSlideoutHelper(){
		mSlideoutHelper.close();
	}

}
